<%@ page import="cn.entity.News2" %>
<%@ page import="cn.NewsDao.NewsDao2" %>
<%@ page import="cn.NewsDaoImpl.NewsDaoImpl2" %><%--
  Created by IntelliJ IDEA.
  User: 范军建
  Date: 2022/4/6
  Time: 14:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<%
    request.setCharacterEncoding("utf-8");
    String id = request.getParameter("name1");
    String name = request.getParameter("name2");

    News2 news2 = new News2();
    news2.setId(Integer.parseInt(id));
    news2.setName(name);
    NewsDao2 newsDao2 = new NewsDaoImpl2();

    if ( newsDao2.update(news2)){
        response.sendRedirect(request.getContextPath()+"/news_category.jsp");
    }else {
        System.out.println("修改失败");
    }








%>
</body>
</html>
